
function LoadProvince(objList)
{
	objList.length=provinceid.length;
	for (var i=0;i<provinceid.length;i++)
	{
		objList.options[i].text=provincename[i];	
		objList.options[i].value=provinceid[i];	
	}
	
}


function LoadCity(pvalue,objListC)
{
	var j=1;
	objListC.length=cityid.length+1;
	objListC.options[0].text = "";
	objListC.options[0].value = "";
	for (var i=0;i<cityid.length;i++)
	{
		if (cityid[i].substr(0,2)==pvalue)
		{
			objListC.options[j].text=cityname[i];
			objListC.options[j].value=cityid[i]+","+citypc[i]+","+cityac[i];
			j=j+1;
		}
	}
	objListC.length=j;
}

function ShowCity(pvalue,objListC,cvalue)
{
	var j=0;
	objListC.length=cityid.length;
	for (var i=0;i<cityid.length;i++)
	{
		if (cityid[i].substr(0,2)==pvalue)
		{
			objListC.options[j].text=cityname[i];
			objListC.options[j].value=cityid[i]+","+citypc[i]+","+cityac[i];
			if(cityid[i]==cvalue)
				objListC.options[j].selected=true;
			j=j+1;
		}
	}
	objListC.length=j;
}
function ShowArea(pvalue,objListC,avalue)
{
	var areaindexs=null;
	if(pvalue!='' && cityarea[pvalue]!='')
	   areaindexs=cityarea[pvalue].split(",");
	if(areaindexs!=null)
	{
	   var selectedindex=null;
	   objListC.length=areaindexs.length+1;
	   for(var i = 0; i < areaindexs.length; i++)
       {
          var areaindex = areaindexs[i];
		  objListC.options[i].text=areaname[areaindex];
		  objListC.options[i].value=areaid[areaindex]+","+areapc[areaindex];
		  if(areaid[areaindex]==avalue)
		   {
			objListC.options[i].selected=true;	
			selectedindex=i;
		   }
       }
	   objListC.options[areaindexs.length].text="";
	   objListC.options[areaindexs.length].value="";	
	   if(selectedindex==null)
          objListC.options[areaindexs.length].selected=true;	
	}
	else
	{
		objListC.length=1;
		objListC.options[0].text="";
		objListC.options[0].value="";
	}
}


function LoadArea(pvalue,objListC)
{
	 if(pvalue!='' && pvalue.indexOf('0')==0)
	   pvalue=pvalue.substring(1,pvalue.length);
	var areaindexs=null;
	if(cityarea[pvalue]!='' && cityarea[pvalue]!=null)	 
	   areaindexs=cityarea[pvalue].split(",");
	if(areaindexs!=null)
	{
	   objListC.length=areaindexs.length+1;
	   for(var i = 0; i < areaindexs.length; i++)
       {
          var areaindex = areaindexs[i];
		  objListC.options[i].text=areaname[areaindex];
		  objListC.options[i].value=areaid[areaindex]+","+areapc[areaindex];
       }
	   objListC.options[areaindexs.length].text="";
	   objListC.options[areaindexs.length].value="";	   
	}
	else
	{
		objListC.length=1;
		objListC.options[0].text="";
		objListC.options[0].value="";
	}
}

function SelectList(objList,idstring)
{
	for (var i=0;i<objList.length;i++)
	{
		if (objList.options[i].value==idstring)
		{
			objList.options[i].selected = true;
			return;
		}
	}
	
}

